package com.ougy.reshop.model.converter;

import java.util.Map;

import com.ougy.reshop.model.GoodsClass;

public class GoodsClassCoverter extends BaseStrutsTypeConverter{

	@Override
	public Object convertFromString(Map arg0, String[] arg1, Class arg2) {
		int id=Integer.parseInt(arg1[0]);
		GoodsClass goodsClass=sGoodsClass.findById(id);
		return goodsClass;
	}

	@Override
	public String convertToString(Map arg0, Object arg1) {
		GoodsClass goodsClass=(GoodsClass)arg1;
		return goodsClass.getClassName();
	}

}
